package com.dayu.recovery.service.impl;

import java.util.List;
import com.dayu.common.utils.DateUtils;
import com.dayu.common.utils.SecurityUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.dayu.recovery.mapper.RecoveryModifyMapper;
import com.dayu.recovery.domain.RecoveryModify;
import com.dayu.recovery.service.IRecoveryModifyService;

/**
 * 调价记录Service业务层处理
 * 
 * @author HK
 * @date 2021-04-16
 */
@Service
public class RecoveryModifyServiceImpl implements IRecoveryModifyService 
{
    @Autowired
    private RecoveryModifyMapper recoveryModifyMapper;

    /**
     * 查询调价记录
     * 
     * @param modifyId 调价记录ID
     * @return 调价记录
     */
    @Override
    public RecoveryModify selectRecoveryModifyById(Long modifyId)
    {
        return recoveryModifyMapper.selectRecoveryModifyById(modifyId);
    }

    /**
     * 查询调价记录列表
     * 
     * @param recoveryModify 调价记录
     * @return 调价记录
     */
    @Override
    public List<RecoveryModify> selectRecoveryModifyList(RecoveryModify recoveryModify)
    {
        return recoveryModifyMapper.selectRecoveryModifyList(recoveryModify);
    }

    /**
     * 新增调价记录
     * 
     * @param recoveryModify 调价记录
     * @return 结果
     */
    @Override
    public int insertRecoveryModify(RecoveryModify recoveryModify)
    {
        recoveryModify.setCreateBy(SecurityUtils.getLoginUser().getUser().getNickName());
        recoveryModify.setCreateTime(DateUtils.getNowDate());
        return recoveryModifyMapper.insertRecoveryModify(recoveryModify);
    }

    /**
     * 修改调价记录
     * 
     * @param recoveryModify 调价记录
     * @return 结果
     */
    @Override
    public int updateRecoveryModify(RecoveryModify recoveryModify)
    {
        return recoveryModifyMapper.updateRecoveryModify(recoveryModify);
    }

    /**
     * 批量删除调价记录
     * 
     * @param modifyIds 需要删除的调价记录ID
     * @return 结果
     */
    @Override
    public int deleteRecoveryModifyByIds(Long[] modifyIds)
    {
        return recoveryModifyMapper.deleteRecoveryModifyByIds(modifyIds);
    }

    /**
     * 删除调价记录信息
     * 
     * @param modifyId 调价记录ID
     * @return 结果
     */
    @Override
    public int deleteRecoveryModifyById(Long modifyId)
    {
        return recoveryModifyMapper.deleteRecoveryModifyById(modifyId);
    }
}
